#ifndef mW_game_include
#define mW_game_include

#include <allegro.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "keyboard.h"
#include "map.h"
#include "mapeditor.h"
#include "mouse.h"
#include "sprite.h"
#include "tile.h"


#define mW_MAP_WIDTH 16
#define mW_MAP_HEIGHT 16



// this is the surface that is written to before being flipped onto 
//   the screen
BITMAP * mW_buffer_page;

// where we store the current map being displayed 
mW_map * mW_current_map;

// text we display in the center of the screen, if not null
char * mW_centered_text;

// this is the sprite that holds the playable character
int mW_player_sprite;



/*
 * Draws the screen for the general map
 * Calls mW_map_blit, mW_sprite_blit, mW_interface_draw, mW_mouse_draw_pointer
 * Draws whatever is in mW_centered_text to the center of the screen, as long 
 *   as mW_centered_text is not null
 */
void mW_game_draw ();

/*
 * The entrance point of the game. Sets up the game and calls mW_game_loop()
 * Creates a timer for mW_game_draw
 */
int mW_game ();

/*
 * The game loop handles all input for the game.
 */
int mW_game_loop ();

/*
 * We send mouse clicks here if they meet no other conditions, and assume this
 * mouse click is interacting with the map.
 */
int mW_game_mouse_click (mW_mouse_click * mouse_click);

/*
 * If we detect a new select_event in mW_game_loop, this function is called
 * We grab the selectbox event and process it here
 */
int mW_game_select_input ();

/*
 * This function is called when the user hits return, allowing text to
 *   be inputed. 
 */
int mW_game_text_interface ();

#endif // mW_game_include
